﻿namespace PersonaLibrary.Commands.SearchCommands
{
	internal static class Commands
	{
		private static NavigateToCommand<PersonaliiReference.Employee> _employeeCommand;
		private static NavigateToCommand<PersonaliiReference.Organization> _organizationCommand;
		private static NavigateToCommand<PersonaliiReference.Job> _jobsCommand;
		private static NavigateToCommand<PersonaliiReference.Note> _notesCommand;

		private static ShowViewModelCommand<ViewModel.SearchViewModel.SearchViewModel<PersonaliiReference.Employee>> _employeeSearch;
		private static ShowViewModelCommand<ViewModel.SearchViewModel.SearchViewModel<PersonaliiReference.Organization>> _organizationSearch;

		public static NavigateToCommand<PersonaliiReference.Employee> EmployeeCommand
		{
			get
			{
				if(_employeeCommand == null)
					_employeeCommand = new NavigateToCommand<PersonaliiReference.Employee>("$expand=EmployeeNoteLink,EmployeeNoteLink/Note&$select=EmployeeNoteLink/Note/Name,*");
				return _employeeCommand;
			}
		}

		public static NavigateToCommand<PersonaliiReference.Organization> OrganizationCommand
		{
			get
			{
				if (_organizationCommand == null)
					_organizationCommand = new NavigateToCommand<PersonaliiReference.Organization>();
				return _organizationCommand;
			}
		}

		public static NavigateToCommand<PersonaliiReference.Job> JobsCommand
		{
			get
			{
				if (_jobsCommand == null)
					_jobsCommand = new NavigateToCommand<PersonaliiReference.Job>();
				return _jobsCommand;
			}
		}

		public static NavigateToCommand<PersonaliiReference.Note> NotesCommand
		{
			get
			{
				if (_notesCommand == null)
					_notesCommand = new NavigateToCommand<PersonaliiReference.Note>();
				return _notesCommand;
			}
		}

		public static ShowViewModelCommand<ViewModel.SearchViewModel.SearchViewModel<PersonaliiReference.Employee>> EmployeeSearchCommand
		{
			get
			{
				if(_employeeSearch == null)
					_employeeSearch = new ShowViewModelCommand<ViewModel.SearchViewModel.SearchViewModel<PersonaliiReference.Employee>>();
				return _employeeSearch;
			}
		}

		public static ShowViewModelCommand<ViewModel.SearchViewModel.SearchViewModel<PersonaliiReference.Organization>> OrganizationSearchCommand
		{
			get
			{
				if(_organizationSearch == null)
					_organizationSearch = new ShowViewModelCommand<ViewModel.SearchViewModel.SearchViewModel<PersonaliiReference.Organization>>();
				return _organizationSearch;
			}
		}
	}
}
